import { createApp } from 'vue'
import App from './App.vue'
// import Maid from './Maid.vue'
import ElementPlus from 'element-plus'
//引入视频样式
import './assets/ciyuan_css/video.css'
//引入广告拦样式
import 'element-plus/dist/index.css'
//引入商城样式
import './assets/ciyuan_css/shopping.css'
//引入登录样式
import './assets/ciyuan_css/login.css'
//引入注册样式
import './assets/ciyuan_css/enroll.css'
//引入设置样式
import './assets/ciyuan_css/Set_up.css'
//引入活动样式
import './assets/ciyuan_css/activity.css'
//引入活动结束样式
import './assets/ciyuan_css/activityOver.css'
//引入活动进行中样式
import './assets/ciyuan_css/activities.css'
//引入首页样式
import './assets/ciyuan_css/maid.css'
//引入购物车样式
import './assets/ciyuan_css/ShoppingCar.css'
//引入商品详细页样式
import './assets/ciyuan_css/ShopDetailed.css'
import store from './store/store'
import router from './router'
//引入适配
import './util/rem'


const app = createApp(App)
app.use(router)
app.use(store)
app.use(ElementPlus)
app.mount('#ap')
router.afterEach((to,from,next) => {
    document.title = to.meta.title
    // this.$router.go(0)
    // location.reload()
    next()
    // console.log('beforeEach')
    // 每次跳转完成后刷新页面
    window.location.reload();
})
// 监听页面回退事件
window.addEventListener('popstate', function() {
    // 每次回退时刷新页面
    location.reload();
});
